package com.fengye.school.model.school.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SubjectLanguageType {
    CHINESE(1, "中文"),
    ENGLISH(2, "英文"),
    JAPANESE(3, "日语"),
    FRENCH(4, "法语"),
    RUSSIAN(5, "俄语"),
    GERMAN(6, "德语"),
    ITALIAN(7, "意大利语"),
    ;
    private final int code;
    private final String name;

    public static SubjectLanguageType getSubjectLanguageTypeByname(String name){
        for(SubjectLanguageType type: SubjectLanguageType.values()){
            if (type.name.equals(name)) {
                return type;
            }
        }
        return null;
    }
}
